
class TradesPerson {
    String personalName
    String businessName
    String body
    String headline

    static hasMany = [ trades : Trade]

    static transients = ['tradesStr']
    static constraints ={
        personalName(blank:false, nullable:false)
        businessName(blank:false, nullable:false)
        headline(blank:false, nullable:false)
        body(blank:true, nullable:true)
    }

    String getTradesStr(){
        return trades.collect{ it.tradeName }.join(', ')
    }
}